package com.ryan.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author raofy
 * @date 2021-10-19 17:15
 * @desc
 */
@RestController
@RequestMapping("/config")
@RefreshScope    // 手动刷新
public class ConfigClientController {
    @Value("${Spring.datasource.username}")
    private String mysqlUser;
    @Value("${Spring.datasource.url}")
    private String personName;

    @RequestMapping("/remote")
    public String findRemoteConfig() {
        return mysqlUser + " " + personName;
    }
}
